﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace OpenGado.Win
{
    public partial class MDIOpenGado : Form
    {
        private int childFormNumber = 0;

        public MDIOpenGado()
        {
            InitializeComponent();
        }

        private void ShowNewForm(object sender, EventArgs e)
        {
            Form childForm = new Form();
            childForm.MdiParent = this;
            childForm.Text = "Window " + childFormNumber++;
            childForm.Show();
        }

        private void OpenFile(object sender, EventArgs e)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            openFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (openFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = openFileDialog.FileName;
            }
        }

        private void SaveAsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();
            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
            saveFileDialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*";
            if (saveFileDialog.ShowDialog(this) == DialogResult.OK)
            {
                string FileName = saveFileDialog.FileName;
            }
        }

        private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void CutToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void CopyToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

        private void PasteToolStripMenuItem_Click(object sender, EventArgs e)
        {
        }

      
      

        private void CascadeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void TileVerticalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void TileHorizontalToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void ArrangeIconsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.ArrangeIcons);
        }

        private void CloseAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        private void mnuIssue_Click(object sender, EventArgs e)
        {
            frmItemIssue issuefrm = new frmItemIssue();
            issuefrm.MdiParent = this;
            issuefrm.modeType = frmItemIssue.CurrModeType.issue;
            issuefrm.Show();
        }

        private void mnuRequest_Click(object sender, EventArgs e)
        {
            frmItemIssue issuefrm = new frmItemIssue();
            issuefrm.MdiParent = this;
            issuefrm.modeType = frmItemIssue.CurrModeType.request;
            issuefrm.Show();
        }

        private void mnuShowStock_Click(object sender, EventArgs e)
        {
            frmProductSearch productSearchForm = new frmProductSearch();
            productSearchForm.MdiParent = this;
            productSearchForm.Show();
        }

        private void mnuStorageLocations_Click(object sender, EventArgs e)
        {
            frmLocationManager locationsManagerFrm = new frmLocationManager();
            locationsManagerFrm.MdiParent = this;
            locationsManagerFrm.Show();

        }

        private void mnuUnitOfMeasure_Click(object sender, EventArgs e)
        {
            frmUnitManager unitManageForm = new frmUnitManager();
            unitManageForm.MdiParent = this;
            unitManageForm.Show();

        }

        private void mnuProductCategories_Click(object sender, EventArgs e)
        {
            frmCategoryManagement categoryManagementForm = new frmCategoryManagement();
            categoryManagementForm.MdiParent = this;
            categoryManagementForm.Show();
        }

        private void mnuProjectManagement_Click(object sender, EventArgs e)
        {
            frmProjectManagement projectManagementForm = new frmProjectManagement();
            projectManagementForm.MdiParent = this;
            projectManagementForm.Show();
        }

        private void mnuNewVendor_Click(object sender, EventArgs e)
        {
      

            frmVendorDetails vendorDetailForm = new frmVendorDetails();
            vendorDetailForm.MdiParent = this;
            vendorDetailForm.Show();
        }

        private void mnuVendorList_Click(object sender, EventArgs e)
        {
            frmVendorManager vendorManagerForm = new frmVendorManager();
            vendorManagerForm.MdiParent = this;
            vendorManagerForm.Show();
        }

        private void mnuNewPurchaseOrder_Click(object sender, EventArgs e)
        {
            frmOrders orders = new frmOrders();
            orders.MdiParent = this;
            orders.Show();
        }

        private void mnuPurchaseOrderList_Click(object sender, EventArgs e)
        {
            frmOrderManagement orderList = new frmOrderManagement();
            orderList.MdiParent = this;
            orderList.Show();
        }

        private void inventoryReportToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //frmReportContainer rpt = new frmReportContainer();
            //rpt.MdiParent = this;
            //rpt.Show();
        }

        private void mnuRequestList_Click(object sender, EventArgs e)
        {
                frmRequests requests = new frmRequests();

            requests.MdiParent = this; 
            requests.Show();
        }

        private void mnuAddProduct_Click(object sender, EventArgs e)
        {
            frmProduct product = new frmProduct();
            product.MdiParent = this; 
            product.Show();
        }

        private void mnuAddStore_Click(object sender, EventArgs e)
        {
            frmStorage storage = new frmStorage();
            storage.MdiParent = this;
            storage.Show();
        }

        private void mnuManageStores_Click(object sender, EventArgs e)
        {
            frmLocationManager locations = new frmLocationManager();
            locations.MdiParent = this;
            locations.Show();

        }

        private void mnuReports_Click(object sender, EventArgs e)
        {
            frmReportLauncher rptLauncher = new frmReportLauncher();
            rptLauncher.MdiParent = this;
            rptLauncher.Show();
        }

      

       
    }
}
